package com.lecture.springlecture.service.impl;

import com.lecture.springlecture.entity.Person;
import com.lecture.springlecture.service.TestService;
import org.kie.api.runtime.KieSession;
import org.springframework.stereotype.Service;

@Service
public class TestServiceImpl implements TestService {

   // @Autowired
    private KieSession kieSession;

    @Override
    public void test() {
        Person person = new Person();
        person.setName("张三");
        person.setAge(18);
        kieSession.insert(person);
        int i = kieSession.fireAllRules();
        System.out.println("一共执行了" + i + "条规则。");
    }
}
